#include "ADC.h"
#include "zf_vadc.h"

void ADC_Initiate()
{
    adc_init(ADC_0, ADC0_CH0_A0);
}
uint16 Power_Detect()
{
    uint16 adc_value, voltage;
    adc_value = adc_mean_filter(ADC_0, ADC0_CH0_A0, ADC_12BIT, 5);
    voltage = 33*(adc_value/0xFFF)/10;
    return voltage;
}
